<?php
include_once( "include/global.php" );
include_once( "include/process_db.php" );
include_once( "include/check_login.php" );
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Accounting - Main Page</title>
<link rel="stylesheet" type="text/css" href="css/input_size.css" />
<link rel="stylesheet" type="text/css" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/ui-lightness/jquery-ui.css">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script>
<script type="text/javascript" src="js/utility.js"></script>
<script type="text/javascript" src="js/initial.js"></script>
<script type="text/javascript" src="js/insert_accounting.js"></script>
<script type="text/javascript" src="js/show_accounting.js"></script>
<script type="text/javascript">
	$(function(){
		// set tabs
		$( "#tabs" ).tabs();
		
		// tab select
		$('#tabs').bind('tabsselect', function(event, ui) {
			// for logout
			if( ui.index == 3 )
			{
				window.location = "logout.php";
				return false;
			}
		});

        // set dateinput
		$(".date_input_format").datepicker({
			dateFormat: 'yy/mm/dd'
		});

		//
		InitMainPage();
	});
</script>
</head>
<body>
<div id="tabs">
	<ul>
		<li><a href="#insert_tab">新增消費</a></li>
		<li><a href="#query_tab">查詢消費</a></li>
		<li><a href="#field_management_tab">類別管理</a></li>
		<li><a href="#logout">登出</a></li>
	</ul>
	<div id="insert_tab"><?php include( "ui_component/insert_accounting.html" ); ?></div>
	<div id="query_tab"><?php include( "ui_component/show_accounting.html" ); ?></div>
	<div id="field_management_tab">Third tab content</div>
	<div id="logout"></div>
</div>
<?php
include_once( "./include/tail.php" );
?>
</body>
</html>
